package com.icinfo.cloud.provider.common.zzd.controller;


import com.alibaba.fastjson.JSONObject;
import com.icinfo.cloud.provider.common.zzd.service.ILoginService;
import com.icinfo.cloud.provider.punish.dto.LoginRequest;
import com.icinfo.framework.common.web.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

@RestController
@RequestMapping("/app/system")
public class AppUserLoginController {
    @Resource
    private ILoginService loginService;
    /**
     * 账号密码登录
     * @author liyafeng
     * @date 2022/12/6
      * @param loginRequest
     * @param request
     * @return {@link Result}
     */
    @PostMapping(value = "/login")
    public JSONObject Login(@RequestBody @Valid LoginRequest loginRequest, HttpServletRequest request) {
        JSONObject loginDTO = loginService.login(loginRequest);
        return loginDTO;
    }
}
